import { Component,ElementRef,OnInit } from '@angular/core';
//var skPlayer = require('skPlayer');
import {skPlayer} from 'skPlayer';

//var elem = document.getElementById('skPlayer');
//console.log('这里是skPlayer元素：',elem);
@Component({
  selector: 'playIndex',
  templateUrl: './play-index.component.html',
  styleUrls: ['./play-index.component.css']
})
export class PlayIndexComponent implements OnInit{
    constructor(private elemmentRef:ElementRef){}
    ngOnInit(){
        var a = this.elemmentRef.nativeElement.querySelector('#skPlayer');
        var player = new skPlayer({
          element:a,
          autoplay: true,
          listshow: true,
          mode: 'listloop',
          music: {
            type: 'cloud',
            source: [472193120,446627093]//472193120,446627093,508739377
          }
        });
    }

}
